// 用指针遍历数组练习
// 数组指针的三种用法
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int arr[] = {0, 1, 2, 3, 4, 5, 6};
    int *p = arr;
    printf("\n------p[i]---------\n");
    for (int i = 0; i <= 6; i++)
        printf("%d", p[i]);

    printf("\n------*(p+i)-------\n");
    for (int i = 0; i <= 6; i++)
        printf("%d", *(p + i));

    printf("\n-------*p++--------\n");
    for (int i = 0; i <= 6; i++)
        printf("%d", *p++);

//	cout<<endl;
//	vector<int> arr2{6,5,4,3,2,1,0};
//	vector<int> *p2 = &arr2;
//    for (int i=0;i<=6;i++)
//        printf("%d",p2++);
}

